<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.linenumber {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='linenumber'>  1</span> <span class="WHIT">
<span class='linenumber'>  2</span> </span><span class="COMM">//test only -> the Layout as JSON </span><span class="WHIT">
<span class='linenumber'>  3</span> 
<span class='linenumber'>  4</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>  5</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"left"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">XPos</span><span class="PUNC">:</span><span class="STRN">"2"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">YPos</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"110"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"200"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"800"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>  6</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"center"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">XPos</span><span class="PUNC">:</span><span class="STRN">"205"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">YPos</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"110"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"600"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"250"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>  7</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"right"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">XPos</span><span class="PUNC">:</span><span class="STRN">"RightMost"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">YPos</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"110"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"600"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"250"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>  8</span> </span><span class="WHIT">               </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"top"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">XPos</span><span class="PUNC">:</span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">YPos</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1200"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"100"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"brick"</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>  9</span> </span><span class="WHIT">               </span><span class="COMM">//{Name: "nowhereman", XPos:"0", YPos: "0", Width: "0", Height: "0", Layout: "brick"}</span><span class="WHIT">
<span class='linenumber'> 10</span> </span><span class="WHIT">              </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 11</span> 
<span class='linenumber'> 12</span> </span><span class="COMM">/*This is the SnapDef Registry (which should be dynamically be loaded somehow)*/</span><span class="WHIT">
<span class='linenumber'> 13</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='linenumber'> 14</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "YUISnapIn", Pos:99, Title: "Layout12", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/intrinsics/snapIn/snapInYUI.js"},</span><span class="WHIT">
<span class='linenumber'> 15</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2112SnapIn"</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2112SnapIn"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/intrinsics/snapIn/snapIn2112.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 16</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "2112DivHook" , Pos:-1, Title: "2112DivHook", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/intrinsics/divHook/divHook.js"},   </span><span class="WHIT">
<span class='linenumber'> 17</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Layout12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Layout12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/intrinsics/layout/stdLayout12.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 18</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "HelloWorld", Pos:99, SIM: "right" ,Title: "HelloWorld", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/samples/HelloWorld/helloworld.js"},</span><span class="WHIT">
<span class='linenumber'> 19</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Semitary"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">99</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Semitary"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"right"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"200"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/2112/snapInSemitary.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 20</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "JoomlaMod", Pos:999 ,Title: "Joomla Modules", SIM: "left", Width: "300", Height: "300", URL: "/2112PowerWindows/widgetBase/samples/joomla/jModuleBox.js"},</span><span class="WHIT">
<span class='linenumber'> 21</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "garbageCollector" ,Title: "Semitary", Width: "200", Height: "150", URL: "/2112PowerWindows/widgetBase/intrinsics/snapIn/snapInCollector.js"},</span><span class="WHIT">
<span class='linenumber'> 22</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Logger12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">99</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Logger12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/intrinsics/logger/logger12.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 23</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"LogReader12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">99</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"LogReader12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"center"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/intrinsics/logger/logReader12.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 24</span> 
<span class='linenumber'> 25</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2112Menu"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">999</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2112Menu"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"top"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"500"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/2112/menu12.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 26</span> </span><span class="COMM">// {Name: "EPPlayer" ,Title: "EPPlayer", Width: "300", Height: "250", URL: "/2112PowerWindows/widgetBase/samples/ephonic/epplayer.js"},               </span><span class="WHIT">
<span class='linenumber'> 27</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 28</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "2112Fifth", Pos:99 ,Title: "2112Fifth", SIM: "right", Width: "200", Height: "150", URL: "/2112PowerWindows/widgetBase/samples/flash/berlinTime.js"},</span><span class="WHIT">
<span class='linenumber'> 29</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"BerlinTime"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">99</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Berlin"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"right"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/samples/flash/berlinTime.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 30</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "LondonTime", Pos:99 ,Title: "London", SIM: "right", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/samples/flash/londonTime.js"},</span><span class="WHIT">
<span class='linenumber'> 31</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "JerusalemTime", Pos:99 ,Title: "Jerusalem", SIM: "right", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/samples/flash/jerusalemTime.js"},</span><span class="WHIT">
<span class='linenumber'> 32</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"stdContent12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">999</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Floating Content12"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"center"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/intrinsics/content/stdContent/stdContent.js"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'> 33</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "embedded", Pos:999 ,Title: "Embedded Content12", SIM: "center", Width: "0", Height: "0", URL: "/2112PowerWindows/widgetBase/intrinsics/content/embedded/embedded.js"},</span><span class="WHIT">
<span class='linenumber'> 34</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 35</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="NAME">Name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"YUICal"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Pos</span><span class="PUNC">:</span><span class="NUMB">99</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="NAME">Title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A Yui Calendar"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">SIM</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"left"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"300"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"150"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">URL</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"/2112PowerWindows/widgetBase/samples/YUI/calendar.js"</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 36</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "JoomlaUserMod", Pos:999, SIM: "right" ,Title: "Joomla User Modules", SIM: "right", Width: "300", Height: "250", URL: "/2112PowerWindows/widgetBase/samples/joomla/jModuleBoxUser.js"}</span><span class="WHIT">
<span class='linenumber'> 37</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "HelloWorld2", Pos:99, SIM: "right" ,Title: "HelloWorld2", Width: "300", Height: "150", URL: "/2112PowerWindows/widgetBase/samples/HelloWorld/helloworld2.js"},</span><span class="WHIT">
<span class='linenumber'> 38</span> </span><span class="WHIT">   </span><span class="COMM">//{Name: "JoomlaSessionInfo", Pos:99 ,Title: "Joomla SessionInfo", SIM: "left", Width: "300", Height: "250", URL: "/2112PowerWindows/widgetBase/samples/joomla/j10Sessions.js"}</span><span class="WHIT">
<span class='linenumber'> 39</span> </span><span class="WHIT">   </span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 40</span> 
<span class='linenumber'> 41</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">SnapDef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 42</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 43</span> </span><span class="WHIT">      </span><span class="NAME">this.URL</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 44</span> </span><span class="WHIT">      </span><span class="NAME">this.Name</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 45</span> </span><span class="WHIT">      </span><span class="NAME">this.Title</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">       </span><span class="WHIT">
<span class='linenumber'> 46</span> </span><span class="WHIT">      </span><span class="NAME">this.SIM</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 47</span> </span><span class="WHIT">      </span><span class="NAME">this.XPos</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 48</span> </span><span class="WHIT">      </span><span class="NAME">this.YPos</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 49</span> </span><span class="WHIT">      </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 50</span> </span><span class="WHIT">      </span><span class="NAME">this.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 51</span> </span><span class="WHIT">      </span><span class="NAME">this.FreeFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 52</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 53</span> 
<span class='linenumber'> 54</span> 
<span class='linenumber'> 55</span> </span><span class="WHIT">   </span><span class="NAME">getSnapInDefinition</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'> 56</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 57</span> 
<span class='linenumber'> 58</span> </span><span class="WHIT">   </span><span class="COMM">//debugger;</span><span class="WHIT">
<span class='linenumber'> 59</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">rSnapIns.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SnapIns</span><span class="WHIT">
<span class='linenumber'> 60</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 61</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">rSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">)</span><span class="WHIT">     </span><span class="COMM">//match</span><span class="WHIT">
<span class='linenumber'> 62</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'> 63</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">rSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">SIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">rSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">SIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 64</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">rSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 65</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 66</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 67</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'> 68</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 69</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'> 70</span> </span><span class="WHIT">   </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">posSort</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 71</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'> 72</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.Pos</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b.Pos</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//reverse since we are a stack</span><span class="WHIT">
<span class='linenumber'> 73</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'> 74</span> 
<span class='linenumber'> 75</span> </span><span class="COMM">/*
<span class='linenumber'> 76</span>    The snapIn12 primordial Class, where all custom snapIns should inherit from.
<span class='linenumber'> 77</span> */</span><span class="WHIT">
<span class='linenumber'> 78</span> 
<span class='linenumber'> 79</span> </span><span class="NAME">NS2112.namespace</span><span class="PUNC">(</span><span class="STRN">'masterControl'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 80</span> 
<span class='linenumber'> 81</span> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'info'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 82</span> </span><span class="NAME">NS2112.CONST_CAT_WARN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'warn'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 83</span> </span><span class="NAME">NS2112.CONST_CAT_ERR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'error'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 84</span> </span><span class="NAME">NS2112.PADPANELPX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 85</span> 
<span class='linenumber'> 86</span> 
<span class='linenumber'> 87</span> 
<span class='linenumber'> 88</span> </span><span class="NAME">NS2112.masterControl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'> 89</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'> 90</span> </span><span class="WHIT">   </span><span class="COMM">//var m_coordinates = ToolMan.coordinates() ;</span><span class="WHIT">
<span class='linenumber'> 91</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_Loader</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 92</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_iContainerID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'> 93</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_rIntrinsics</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//the intrinsic snapins (Layout, logger...)</span><span class="WHIT">
<span class='linenumber'> 94</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="COMM">// new Object() ; //associate SIM-Name - Snap</span><span class="WHIT">
<span class='linenumber'> 95</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//an array of slots</span><span class="WHIT">
<span class='linenumber'> 96</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//singleton</span><span class="WHIT">
<span class='linenumber'> 97</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">//singleton drag shim for enhanced drag performance</span><span class="WHIT">
<span class='linenumber'> 98</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_silo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//the snapin loader</span><span class="WHIT">
<span class='linenumber'> 99</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_snapNum</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//for generating a snapin element Id</span><span class="WHIT">
<span class='linenumber'>100</span> </span><span class="WHIT">   </span><span class="COMM">// no more used - eliminate all YUI - Stuff... var m_OverlayManager = new YAHOO.widget.OverlayManager(); </span><span class="WHIT">
<span class='linenumber'>101</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_BugPrisonName</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'bugprison'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>102</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">strSourceSIMName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//holds the sims name to prevent overwriting.</span><span class="WHIT">
<span class='linenumber'>103</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bDragInProgress</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>104</span> 
<span class='linenumber'>105</span> 
<span class='linenumber'>106</span> </span><span class="WHIT">   </span><span class="NAME">this.onIntrinsicReady</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.CustomEvent</span><span class="PUNC">(</span><span class="STRN">"onIntrinsicReady"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>107</span> </span><span class="WHIT">   </span><span class="NAME">this.onSnapInLoaded</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.CustomEvent</span><span class="PUNC">(</span><span class="STRN">"onSnapInLoaded"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>108</span> </span><span class="WHIT">   </span><span class="NAME">this.onSnapInUnload</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.CustomEvent</span><span class="PUNC">(</span><span class="STRN">"onSnapInUnload"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>109</span> </span><span class="WHIT">   </span><span class="NAME">this.onSnapInRecycle</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.CustomEvent</span><span class="PUNC">(</span><span class="STRN">"onSnapInRecycle"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>110</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>111</span> </span><span class="WHIT">   </span><span class="NAME">YAHOO.widget.Module.textResizeEvent.subscribe</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>112</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iDelta</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>113</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>114</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>115</span> 
<span class='linenumber'>116</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">mc</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>117</span> </span><span class="WHIT">     </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"textResizeEvent - failed to get mc."</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_ERROR</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>118</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT">
<span class='linenumber'>119</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>120</span> 
<span class='linenumber'>121</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='linenumber'>122</span> 
<span class='linenumber'>123</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>124</span> </span><span class="WHIT">        </span><span class="PUNC">{</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>125</span> </span><span class="WHIT">         </span><span class="NAME">currentSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>126</span> </span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>127</span> </span><span class="WHIT">         </span><span class="NAME">currentSnap.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">currentSnap.m_Panel.body.firstChild.clientWidth</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>128</span> 
<span class='linenumber'>129</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">currentSnap.Width</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>130</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>131</span> </span><span class="WHIT">           </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="NAME">currentSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>132</span> </span><span class="WHIT">                           </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.body.firstChild.clientWidth</span><span class="PUNC">,</span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>133</span> </span><span class="WHIT">           </span><span class="NAME">iDelta</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">currentSnap.Width</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">currentSnap.m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>134</span> </span><span class="WHIT">           </span><span class="WHIT">
<span class='linenumber'>135</span> </span><span class="COMM">//if the Snap Width gets wider than the SIMS width we need to adjust the layout and the SIMS width</span><span class="WHIT">
<span class='linenumber'>136</span> 
<span class='linenumber'>137</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mc.getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'layout'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>138</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>139</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>140</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>141</span> </span><span class="WHIT">               </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">currentSnap.m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">currentSnap.Width</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>142</span> </span><span class="WHIT">               </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l.IntrinsicObject.get</span><span class="PUNC">(</span><span class="NAME">currentSnap.m_responsibleSIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>143</span> </span><span class="WHIT">               </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>144</span> </span><span class="WHIT">                 </span><span class="NAME">s.setWidth</span><span class="PUNC">(</span><span class="NAME">currentSnap.Width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>145</span> </span><span class="WHIT">                 </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"textResizeEvent - adjustLayout ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">currentSnap.m_responsibleSIM.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">currentSnap.Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>146</span> </span><span class="WHIT">                    </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>147</span> </span><span class="WHIT">                 </span><span class="WHIT">
<span class='linenumber'>148</span> </span><span class="WHIT">               </span><span class="PUNC">}</span><span class="WHIT">                </span><span class="WHIT">
<span class='linenumber'>149</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">                    </span><span class="WHIT">
<span class='linenumber'>150</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>151</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>152</span> </span><span class="WHIT">      </span><span class="NAME">mc.adjustLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>153</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>154</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>155</span> 
<span class='linenumber'>156</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>157</span> </span><span class="WHIT">   </span><span class="NAME">this.getIntrinsic</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strName</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>158</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>159</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m_rIntrinsics</span><span class="PUNC">[</span><span class="NAME">strName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>160</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>161</span> 
<span class='linenumber'>162</span> 
<span class='linenumber'>163</span> </span><span class="WHIT">   </span><span class="NAME">this.createSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strUniqueName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>164</span> </span><span class="WHIT">                        </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strUnitW</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strUnitH</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNoBorder</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCanClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCanFloat</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>165</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>166</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">si</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'snapin'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>167</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>168</span> </span><span class="WHIT">      </span><span class="COMM">//Since we are loading through ajax and eval, we absolutely make sure that no</span><span class="WHIT">
<span class='linenumber'>169</span> </span><span class="WHIT">      </span><span class="COMM">//'undefined' values travel the wire - since this would lead to a </span><span class="WHIT">
<span class='linenumber'>170</span> </span><span class="WHIT">      </span><span class="COMM">// 'not wellformed' error.</span><span class="WHIT">
<span class='linenumber'>171</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">theContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>172</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strUniqueName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strUniqueName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>173</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>174</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>175</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>176</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strUnitW</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strUnitW</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>177</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>178</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strUnitH</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strUnitH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>179</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">bNoBorder</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">bNoBorder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>180</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">bCanClose</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">bCanClose</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">           </span><span class="WHIT">
<span class='linenumber'>181</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">si</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>182</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>183</span> </span><span class="WHIT">         </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">si.IntrinsicObject.create</span><span class="WHIT">
<span class='linenumber'>184</span> </span><span class="WHIT">           </span><span class="PUNC">(</span><span class="NAME">this.queryDrag</span><span class="PUNC">,</span><span class="NAME">this.queryDrop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.queryUnload</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>185</span> </span><span class="WHIT">             </span><span class="NAME">theContent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strUniqueName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>186</span> </span><span class="WHIT">                        </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNoBorder</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">bCanClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCanFloat</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>187</span> </span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>188</span> </span><span class="WHIT">         </span><span class="NAME">si.IntrinsicObject.show</span><span class="PUNC">(</span><span class="NAME">myPanel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>189</span> </span><span class="WHIT">         </span><span class="NAME">this.registerOverlay</span><span class="PUNC">(</span><span class="NAME">myPanel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//eliminate this plz</span><span class="WHIT">
<span class='linenumber'>190</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>191</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>192</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>193</span> </span><span class="WHIT">   </span><span class="COMM">/*The function is a bit of a simplification and should get more refined.*/</span><span class="WHIT">
<span class='linenumber'>194</span> </span><span class="WHIT">   </span><span class="COMM">/*take care: since this is an event that was fired - oSnap is an Array*/</span><span class="WHIT">
<span class='linenumber'>195</span> </span><span class="WHIT">   </span><span class="NAME">this.onContentReady</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strEventName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>196</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>197</span> </span><span class="WHIT">      </span><span class="COMM">//alert("onContentReady " + strURL) ;</span><span class="WHIT">
<span class='linenumber'>198</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>199</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>200</span> </span><span class="WHIT">      </span><span class="NAME">mc.onSnapInLoaded.unsubscribe</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.onContentReady</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>201</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">rSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>202</span> </span><span class="COMM">/*
<span class='linenumber'>203</span> 
<span class='linenumber'>204</span> Must display the content SnapIn here: since it is intrinisic it will not be shown yet!00
<span class='linenumber'>205</span> 
<span class='linenumber'>206</span> */</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>207</span> </span><span class="WHIT">      </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>208</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">mySnapDef.FreeFloat</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>209</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>210</span> </span><span class="WHIT">         </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'nowhereman'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>211</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>212</span> 
<span class='linenumber'>213</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">mySnapDef.Width</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>214</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>215</span> </span><span class="WHIT">         </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySnapDef.Width</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>216</span> </span><span class="WHIT">         </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FitToHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>217</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>218</span> 
<span class='linenumber'>219</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT">  </span><span class="NAME">mySnapDef.Height</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>220</span> </span><span class="WHIT">         </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySnapDef.Height</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>221</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>222</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>223</span> 
<span class='linenumber'>224</span> </span><span class="WHIT">      </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FreeFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySnapDef.FreeFloat</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>225</span> 
<span class='linenumber'>226</span> </span><span class="WHIT">      </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>227</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>228</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="STRN">'center'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">showSnapIn</span><span class="PUNC">(</span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mc.createContainer</span><span class="PUNC">(</span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>229</span> </span><span class="WHIT">                </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FreeFloat</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>230</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>231</span> </span><span class="WHIT">      </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.resize</span><span class="PUNC">(</span><span class="NAME">mySnapDef.Width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapDef.Height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>232</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FreeFloat</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>233</span> </span><span class="WHIT">         </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.moveTo</span><span class="PUNC">(</span><span class="NAME">mySnapDef.XPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapDef.YPos</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>234</span> </span><span class="WHIT">      </span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.setBody</span><span class="PUNC">(</span><span class="NAME">rSnap</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">loadContent</span><span class="PUNC">(</span><span class="NAME">mySnapDef.URL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>235</span> </span><span class="COMM">//alert(rSnap[0].m_responsibleSIM) ;</span><span class="WHIT">
<span class='linenumber'>236</span> </span><span class="WHIT">  </span><span class="COMM">//    if( 'nowhereman' == rSnap[0].m_responsibleSIM ) return  ;</span><span class="WHIT">
<span class='linenumber'>237</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="STRN">'center'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>238</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>239</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>240</span> 
<span class='linenumber'>241</span> 
<span class='linenumber'>242</span> </span><span class="WHIT">   </span><span class="COMM">//contentRequested can be called by any snap in, but usually from a menu to show </span><span class="WHIT">
<span class='linenumber'>243</span> </span><span class="WHIT">   </span><span class="COMM">//content from a URL.</span><span class="WHIT">
<span class='linenumber'>244</span> </span><span class="WHIT">   </span><span class="NAME">this.contentRequested</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strIntrinsic</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strObject</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>245</span> </span><span class="WHIT">                                    </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iXPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iYPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNewWindow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bFreeFloat</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>246</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>247</span> </span><span class="WHIT">      </span><span class="COMM">//strIntrinsic could be 'content' or 'embedded'</span><span class="WHIT">
<span class='linenumber'>248</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getIntrinsic</span><span class="PUNC">(</span><span class="NAME">strIntrinsic</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//try to find a carrier for the request.</span><span class="WHIT">
<span class='linenumber'>249</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>250</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>251</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>252</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>253</span> </span><span class="WHIT">      </span><span class="COMM">//user requested a new window</span><span class="WHIT">
<span class='linenumber'>254</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">bNewWindow</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>255</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>256</span> </span><span class="WHIT">         </span><span class="COMM">//subscribe to the loading function</span><span class="WHIT">
<span class='linenumber'>257</span> </span><span class="WHIT">         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">SnapDef</span><span class="PUNC">(</span><span class="NAME">strObject</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>258</span> </span><span class="WHIT">         </span><span class="NAME">mySnapDef.FreeFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bFreeFloat</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>259</span> </span><span class="WHIT">         </span><span class="NAME">mySnapDef.XPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iXPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>260</span> </span><span class="WHIT">         </span><span class="NAME">mySnapDef.YPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iYPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>261</span> </span><span class="WHIT">         </span><span class="NAME">mySnapDef.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>262</span> </span><span class="WHIT">         </span><span class="NAME">mySnapDef.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>263</span> </span><span class="WHIT">         </span><span class="NAME">this.onSnapInLoaded.subscribe</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.onContentReady</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>264</span> </span><span class="WHIT">         </span><span class="NAME">l.clone</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//this would start a chain of actions</span><span class="WHIT">
<span class='linenumber'>265</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>266</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>267</span> 
<span class='linenumber'>268</span> </span><span class="COMM">//not a new window - show content in our std window (recycle it if neccessary.</span><span class="WHIT">
<span class='linenumber'>269</span> </span><span class="WHIT">      </span><span class="COMM">//workaround for SAFARI - usually it would be sufficient to just reset the body.</span><span class="WHIT">
<span class='linenumber'>270</span> </span><span class="WHIT">      </span><span class="COMM">//...</span><span class="WHIT">
<span class='linenumber'>271</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">l.m_Panel</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>272</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>273</span> </span><span class="WHIT">         </span><span class="NAME">l.m_Panel.destroy</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>274</span> </span><span class="WHIT">         </span><span class="NAME">l.m_Panel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>275</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>276</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>277</span> 
<span class='linenumber'>278</span> </span><span class="WHIT">      </span><span class="COMM">//which SIM would host this snap?</span><span class="WHIT">
<span class='linenumber'>279</span> </span><span class="WHIT">      </span><span class="COMM">//currently we would simply put the content into the center SIM</span><span class="WHIT">
<span class='linenumber'>280</span> </span><span class="WHIT">      </span><span class="NAME">l.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="STRN">'center'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//important to set</span><span class="WHIT">
<span class='linenumber'>281</span> </span><span class="WHIT">      </span><span class="COMM">//copy the intrinsic over to the snapin array so SIMs could manage it.</span><span class="WHIT">
<span class='linenumber'>282</span> </span><span class="WHIT">      </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">l.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>283</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="STRN">'center'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">showSnapIn</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.createContainer</span><span class="PUNC">(</span><span class="NAME">l.Name</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>284</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="STRN">'center'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">           </span><span class="WHIT">
<span class='linenumber'>285</span> </span><span class="WHIT">               </span><span class="WHIT">
<span class='linenumber'>286</span> </span><span class="WHIT">      </span><span class="NAME">l.m_Panel.setBody</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l.loadContent</span><span class="PUNC">(</span><span class="NAME">strObject</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>287</span> </span><span class="WHIT">      </span><span class="COMM">//just in case the user closed the content window - resurrect.</span><span class="WHIT">
<span class='linenumber'>288</span> </span><span class="WHIT">      </span><span class="COMM">//alert('contentRequested: informing listeners') ;</span><span class="WHIT">
<span class='linenumber'>289</span> </span><span class="WHIT">      </span><span class="NAME">this.recycle</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>290</span> </span><span class="WHIT">      </span><span class="NAME">this.onSnapInRecycle.fire</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>291</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>292</span> 
<span class='linenumber'>293</span> 
<span class='linenumber'>294</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>295</span> 
<span class='linenumber'>296</span> </span><span class="WHIT">   </span><span class="COMM">//theDiv could be a string or an element</span><span class="WHIT">
<span class='linenumber'>297</span> </span><span class="WHIT">   </span><span class="NAME">this.hookDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theDiv</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>298</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>299</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oCloned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>300</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'divHook'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//try to find a carrier for the request.</span><span class="WHIT">
<span class='linenumber'>301</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>302</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>303</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>304</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>305</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>306</span> </span><span class="WHIT">      </span><span class="NAME">oCloned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l.clone</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//this would start a chain of actions by calling registerSnapIn     </span><span class="WHIT">
<span class='linenumber'>307</span> </span><span class="WHIT">      </span><span class="COMM">//which SIM would host this snap?</span><span class="WHIT">
<span class='linenumber'>308</span> </span><span class="WHIT">      </span><span class="COMM">//currently we would simply put the content into the center SIM</span><span class="WHIT">
<span class='linenumber'>309</span> </span><span class="WHIT">      </span><span class="NAME">l.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//important to set</span><span class="WHIT">
<span class='linenumber'>310</span> </span><span class="WHIT">      </span><span class="COMM">//copy the intrinsic over to the snapin array so SIMs could manage it.</span><span class="WHIT">
<span class='linenumber'>311</span> </span><span class="WHIT">      </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">l.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>312</span> </span><span class="WHIT">      </span><span class="NAME">l.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>313</span> </span><span class="WHIT">      </span><span class="NAME">l.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>314</span> </span><span class="WHIT">      </span><span class="NAME">l.Title</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>315</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">strSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">showSnapIn</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theDiv</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">l.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>316</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">strSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>317</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>318</span> 
<span class='linenumber'>319</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>320</span> 
<span class='linenumber'>321</span> 
<span class='linenumber'>322</span> </span><span class="WHIT">   </span><span class="NAME">this.getLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//unitname is top/left/bottom/right</span><span class="WHIT">
<span class='linenumber'>323</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>324</span> 
<span class='linenumber'>325</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'layout'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>326</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT">              </span><span class="WHIT">
<span class='linenumber'>327</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">l.IntrinsicObject.getSizes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>328</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>329</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>330</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>331</span> 
<span class='linenumber'>332</span> </span><span class="WHIT">   </span><span class="NAME">this.recycle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>333</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>334</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">si</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'snapin'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>335</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">si</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">si.IntrinsicObject.show</span><span class="PUNC">(</span><span class="NAME">theSnap.m_Panel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>336</span> </span><span class="WHIT">      </span><span class="NAME">this.onSnapInRecycle.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>337</span> </span><span class="WHIT">      </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">theSnap.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>338</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">theSnap.m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">       </span><span class="WHIT">
<span class='linenumber'>339</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>340</span> 
<span class='linenumber'>341</span> </span><span class="WHIT">   </span><span class="COMM">//check our SIMReg - </span><span class="WHIT">
<span class='linenumber'>342</span> </span><span class="WHIT">   </span><span class="NAME">this.dumpLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//debug functionality only - ignore</span><span class="WHIT">
<span class='linenumber'>343</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>344</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>345</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>346</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>347</span> </span><span class="WHIT">         </span><span class="COMM">//alert(X) ;</span><span class="WHIT">
<span class='linenumber'>348</span> </span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>349</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'SIM ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] X ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">XPos</span><span class="WHIT">
<span class='linenumber'>350</span> </span><span class="WHIT">                   </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] Y ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">  </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">YPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' W ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>351</span> </span><span class="WHIT">                   </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] H ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="WHIT">
<span class='linenumber'>352</span> </span><span class="WHIT">                   </span><span class="PUNC">,</span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>353</span> </span><span class="WHIT">                   </span><span class="WHIT">
<span class='linenumber'>354</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>355</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>356</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>357</span> 
<span class='linenumber'>358</span> </span><span class="WHIT">   </span><span class="NAME">this.adjustLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>359</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>360</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">size</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>361</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">size</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>362</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"***************  adjustLayout size is undefined"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>363</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>364</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>365</span> </span><span class="WHIT">      </span><span class="COMM">//since we use YAHOO Layout Beta (from 2.5) we need to get around certain beta issues:</span><span class="WHIT">
<span class='linenumber'>366</span> </span><span class="WHIT">      </span><span class="COMM">//YLayout will not provide left and top properties for all units, since these are</span><span class="WHIT">
<span class='linenumber'>367</span> </span><span class="WHIT">      </span><span class="COMM">//calculated from other props. - Therefore we need to do some calculation here.</span><span class="WHIT">
<span class='linenumber'>368</span> 
<span class='linenumber'>369</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>370</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>371</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>372</span> </span><span class="WHIT">            </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>373</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"***************  adjustLayout size.left of  ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] is undefined"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">             </span><span class="WHIT">
<span class='linenumber'>374</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>375</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>376</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"***************  adjustLayout size.top of  ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] is undefined"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>377</span> </span><span class="WHIT">          </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>378</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>379</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">XPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">?</span><span class="NUMB">0</span><span class="PUNC">:</span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>380</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">YPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">?</span><span class="NUMB">0</span><span class="PUNC">:</span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>381</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>382</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>383</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>384</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>385</span> 
<span class='linenumber'>386</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>387</span> 
<span class='linenumber'>388</span> 
<span class='linenumber'>389</span> 
<span class='linenumber'>390</span> </span><span class="WHIT">   </span><span class="COMM">//this would run as callback, so  </span><span class="WHIT">
<span class='linenumber'>391</span> </span><span class="WHIT">   </span><span class="COMM">//d o  n o t   r e l y   o n   a   v a l i d   t h i s   -    p  o i n t e r</span><span class="WHIT">
<span class='linenumber'>392</span> 
<span class='linenumber'>393</span> </span><span class="WHIT">   </span><span class="NAME">this.queryDrag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>394</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>395</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">bDragInProgress</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>396</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'layout'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>397</span> 
<span class='linenumber'>398</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>399</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>400</span> </span><span class="WHIT">         </span><span class="NAME">l.drawGrid</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>401</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>402</span> </span><span class="WHIT">      </span><span class="NAME">bDragInProgress</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>403</span> 
<span class='linenumber'>404</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">debug</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="STRN">"shim"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>405</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">debug</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>406</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>407</span> </span><span class="WHIT">   </span><span class="NAME">debug.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'block'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>408</span> </span><span class="WHIT">   </span><span class="NAME">debug.style.zIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">65535</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>409</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>410</span> </span><span class="COMM">/*
<span class='linenumber'>411</span>      var dragAccel = NS2112.portalMan.getMasterControl().getDragShim() ;
<span class='linenumber'>412</span>      if( null != dragAccel )
<span class='linenumber'>413</span>      {
<span class='linenumber'>414</span>         dragAccel.style.zIndex = 65535 ;
<span class='linenumber'>415</span>         dragAccel.style.left = '0px';
<span class='linenumber'>416</span>         dragAccel.style.top = '0px';
<span class='linenumber'>417</span>         dragAccel.style.width = YAHOO.util.Dom.getViewportWidth() + 'px' ;
<span class='linenumber'>418</span>         dragAccel.style.height = YAHOO.util.Dom.getViewportHeight() + 'px' ;
<span class='linenumber'>419</span>         dragAccel.style.backgroundColor = "yellow";
<span class='linenumber'>420</span>      }
<span class='linenumber'>421</span> */</span><span class="WHIT">
<span class='linenumber'>422</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>423</span> 
<span class='linenumber'>424</span> </span><span class="WHIT">   </span><span class="NAME">this.queryDrop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">thePanelName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>425</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">//check which sim was hit and inform it           </span><span class="WHIT">
<span class='linenumber'>426</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySnapSource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>427</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySnapTarget</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>428</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myCurrentSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>429</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySourceSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>430</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bFoundHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>431</span> </span><span class="COMM">//debugger;  //ie</span><span class="WHIT">
<span class='linenumber'>432</span> </span><span class="WHIT">      </span><span class="NAME">bDragInProgress</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>433</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'layout'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>434</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>435</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>436</span> </span><span class="WHIT">         </span><span class="NAME">l.hideGrid</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>437</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>438</span> 
<span class='linenumber'>439</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>440</span> 
<span class='linenumber'>441</span> </span><span class="COMM">/*
<span class='linenumber'>442</span>       var dragAccel = NS2112.portalMan.getMasterControl().getDragShim() ;
<span class='linenumber'>443</span>      if( null != dragAccel )
<span class='linenumber'>444</span>      {
<span class='linenumber'>445</span>         dragAccel.style.zIndex = -1 ;
<span class='linenumber'>446</span>         dragAccel.style.backgroundColor = "black";
<span class='linenumber'>447</span>       }
<span class='linenumber'>448</span> */</span><span class="WHIT">
<span class='linenumber'>449</span> 
<span class='linenumber'>450</span> 
<span class='linenumber'>451</span> 
<span class='linenumber'>452</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">debug</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="STRN">"shim"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>453</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">debug</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>454</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>455</span> </span><span class="WHIT">   </span><span class="NAME">debug.style.zIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>456</span> </span><span class="WHIT">   </span><span class="NAME">debug.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>457</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>458</span> 
<span class='linenumber'>459</span> 
<span class='linenumber'>460</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"mc.queryDrop"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">       </span><span class="WHIT">
<span class='linenumber'>461</span> </span><span class="COMM">//search the snap</span><span class="WHIT">
<span class='linenumber'>462</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>463</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>464</span> </span><span class="WHIT">         </span><span class="NAME">myCurrentSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>465</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">myCurrentSnap.m_Panel.getWindowName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">thePanelName</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>466</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//found</span><span class="WHIT">
<span class='linenumber'>467</span> </span><span class="WHIT">            </span><span class="NAME">mySnapSource</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">myCurrentSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>468</span> </span><span class="WHIT">            </span><span class="KEYW">break</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//cannot be source and target at once.</span><span class="WHIT">
<span class='linenumber'>469</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>470</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>471</span> </span><span class="COMM">//alert(myCurrentSnap.m_Panel.getWindowName()) ;</span><span class="WHIT">
<span class='linenumber'>472</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">mySnapSource</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>473</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>474</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT">  </span><span class="NAME">mySnapSource.FreeFloat</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>475</span> </span><span class="WHIT">         </span><span class="COMM">//set snap to limbo state</span><span class="WHIT">
<span class='linenumber'>476</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"mc.queryDrop - Limbo"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>477</span> </span><span class="WHIT">         </span><span class="NAME">mySourceSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//must save this</span><span class="WHIT">
<span class='linenumber'>478</span> </span><span class="WHIT">         </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>479</span> </span><span class="WHIT">         </span><span class="NAME">mySnapSource.X</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>480</span> </span><span class="WHIT">         </span><span class="NAME">mySnapSource.Y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>481</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">mySourceSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>482</span> 
<span class='linenumber'>483</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>484</span> 
<span class='linenumber'>485</span> 
<span class='linenumber'>486</span> 
<span class='linenumber'>487</span> </span><span class="WHIT">      </span><span class="COMM">//search the sim-target</span><span class="WHIT">
<span class='linenumber'>488</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>489</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>490</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">queryDrop</span><span class="PUNC">(</span><span class="NAME">mySnapSource.X</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapSource.Y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>491</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>492</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">canHost</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">mySnapSource.Width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mySnapSource.Height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>493</span> </span><span class="WHIT">                  </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Layout</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="WHIT">  </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">mySnapSource.FitToHost</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>494</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>495</span> </span><span class="WHIT">                  </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>496</span> </span><span class="WHIT">                  </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"mc.queryDrop found SIM ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>497</span> </span><span class="WHIT">                  </span><span class="WHIT">
<span class='linenumber'>498</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>499</span> </span><span class="WHIT">            </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>500</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>501</span> </span><span class="WHIT">                  </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"mc.queryDrop - found no host - resnapping"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>502</span> </span><span class="WHIT">                  </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySourceSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//back to the origin.</span><span class="WHIT">
<span class='linenumber'>503</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>504</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>505</span> </span><span class="WHIT">            </span><span class="KEYW">break</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>506</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>507</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>508</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySourceSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>509</span> 
<span class='linenumber'>510</span> </span><span class="WHIT">      </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">mySnapSource.m_responsibleSIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>511</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>512</span> 
<span class='linenumber'>513</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>514</span> 
<span class='linenumber'>515</span> </span><span class="WHIT">   </span><span class="NAME">this.queryUnload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">thePanelName</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>516</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>517</span> </span><span class="WHIT">      </span><span class="COMM">//find the Panel and unload the snap.</span><span class="WHIT">
<span class='linenumber'>518</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>519</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>520</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.getWindowName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">thePanelName</span><span class="PUNC">)</span><span class="WHIT">     </span><span class="COMM">//match</span><span class="WHIT">
<span class='linenumber'>521</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>522</span> </span><span class="WHIT">            </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">unload</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//call the snap and ask it to leave </span><span class="WHIT">
<span class='linenumber'>523</span> </span><span class="WHIT">            </span><span class="COMM">//NS2112.portalMan.getMasterControl().garbageCollect(m_rSnapRegistry[X]) ;</span><span class="WHIT">
<span class='linenumber'>524</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">onSnapInUnload.fire</span><span class="PUNC">(</span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//to those who care</span><span class="WHIT">
<span class='linenumber'>525</span> </span><span class="WHIT">            </span><span class="NAME">theSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>526</span> </span><span class="WHIT">            </span><span class="COMM">//m_rSnapRegistry[X].m_Panel.destroy() ;  //hm, this would lead to a runtime error...</span><span class="WHIT">
<span class='linenumber'>527</span> </span><span class="WHIT">            </span><span class="COMM">//m_rSnapRegistry[X].m_Panel = null ;</span><span class="WHIT">
<span class='linenumber'>528</span> </span><span class="WHIT">            </span><span class="KEYW">delete</span><span class="PUNC">(</span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>529</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">theSIM</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>530</span> </span><span class="WHIT">            </span><span class="PUNC">{</span><span class="COMM">//Ask the associated SIM to regroup</span><span class="WHIT">
<span class='linenumber'>531</span> </span><span class="WHIT">               </span><span class="NAME">theSIM.rebuild</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>532</span> </span><span class="WHIT">              </span><span class="COMM">//theSIM.closeGap(m_rSnapRegistry[X]);</span><span class="WHIT">
<span class='linenumber'>533</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>534</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>535</span> </span><span class="WHIT">                        </span><span class="WHIT">
<span class='linenumber'>536</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>537</span> </span><span class="WHIT">            </span><span class="KEYW">break</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>538</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>539</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>540</span> 
<span class='linenumber'>541</span> </span><span class="WHIT">      </span><span class="COMM">//tbi -> if not found?</span><span class="WHIT">
<span class='linenumber'>542</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>543</span> 
<span class='linenumber'>544</span> 
<span class='linenumber'>545</span> </span><span class="WHIT">   </span><span class="NAME">this.getNewID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//SIMs would call this to generate a Id</span><span class="WHIT">
<span class='linenumber'>546</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>547</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_snapNum</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>548</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>549</span> 
<span class='linenumber'>550</span> </span><span class="WHIT">   </span><span class="NAME">this.registerOverlay</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">thePanel</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>551</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>552</span> </span><span class="WHIT">      </span><span class="COMM">//m_OverlayManager.register(thePanel) ;     </span><span class="WHIT">
<span class='linenumber'>553</span> </span><span class="WHIT">      </span><span class="NAME">portalMan.getWindowManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">OverlayManager.register</span><span class="PUNC">(</span><span class="NAME">thePanel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>554</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>555</span> 
<span class='linenumber'>556</span> </span><span class="WHIT">   </span><span class="NAME">this.getBugPrisonName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>557</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>558</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m_BugPrisonName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>559</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>560</span> 
<span class='linenumber'>561</span> </span><span class="WHIT">   </span><span class="NAME">this.getBugPrison</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>562</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>563</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//singleton</span><span class="WHIT">
<span class='linenumber'>564</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>565</span> </span><span class="WHIT">          </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"div"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>566</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"id"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>567</span> </span><span class="WHIT">          </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"bugprison"</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>568</span> </span><span class="WHIT">          </span><span class="NAME">m_BugPrison.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>569</span> </span><span class="WHIT">          </span><span class="NAME">document.body.appendChild</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>570</span> </span><span class="WHIT">          </span><span class="NAME">m_BugPrison.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'block'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>571</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>572</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>573</span> </span><span class="WHIT">          </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">m_BugPrisonName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>574</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>575</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m_BugPrison</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>576</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>577</span> </span><span class="WHIT">   </span><span class="NAME">this.getDragShim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>578</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>579</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//singleton</span><span class="WHIT">
<span class='linenumber'>580</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>581</span> </span><span class="WHIT">          </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"div"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>582</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"id"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>583</span> </span><span class="WHIT">          </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"dragshim"</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>584</span> </span><span class="WHIT">          </span><span class="NAME">m_DragShim.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>585</span> </span><span class="WHIT">          </span><span class="NAME">document.body.appendChild</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>586</span> </span><span class="WHIT">          </span><span class="NAME">m_DragShim.style.zIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>587</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>588</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>589</span> </span><span class="WHIT">          </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="STRN">"dragshim"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>590</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>591</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m_DragShim</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>592</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>593</span> 
<span class='linenumber'>594</span> </span><span class="WHIT">   </span><span class="NAME">this.createContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strSnapName</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>595</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>596</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"div"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>597</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"id"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>598</span> </span><span class="WHIT">          </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strSnapName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_iContainerID</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>599</span> </span><span class="WHIT">          </span><span class="NAME">m_iContainerID</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>600</span> </span><span class="WHIT">          </span><span class="NAME">myContainer.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>601</span> </span><span class="WHIT">          </span><span class="NAME">this.getBugPrison</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendChild</span><span class="PUNC">(</span><span class="NAME">myContainer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>602</span> </span><span class="WHIT">          </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">myContainer</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>603</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>604</span> 
<span class='linenumber'>605</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>606</span> 
<span class='linenumber'>607</span> </span><span class="WHIT">   </span><span class="NAME">this.countSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strSIMName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//result array</span><span class="WHIT">
<span class='linenumber'>608</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>609</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>610</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>611</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>612</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">strSIMName</span><span class="PUNC">)</span><span class="WHIT">     </span><span class="COMM">//match</span><span class="WHIT">
<span class='linenumber'>613</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>614</span> </span><span class="WHIT">            </span><span class="NAME">iCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>615</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>616</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>617</span> </span><span class="WHIT">     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">iCount</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>618</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>619</span> 
<span class='linenumber'>620</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>621</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>622</span> </span><span class="WHIT">   </span><span class="COMM">//Deliver a list of snapins for a SIM</span><span class="WHIT">
<span class='linenumber'>623</span> </span><span class="WHIT">   </span><span class="NAME">this.getSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strSIMName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">r_SnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//result array</span><span class="WHIT">
<span class='linenumber'>624</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>625</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>626</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>627</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>628</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">strSIMName</span><span class="PUNC">)</span><span class="WHIT">     </span><span class="COMM">//match</span><span class="WHIT">
<span class='linenumber'>629</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>630</span> </span><span class="WHIT">            </span><span class="NAME">r_SnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>631</span> </span><span class="WHIT">            </span><span class="NAME">iCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>632</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>633</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>634</span> </span><span class="WHIT">     </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">iCount</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>635</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>636</span> 
<span class='linenumber'>637</span> </span><span class="WHIT">   </span><span class="NAME">this.loadLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>638</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>639</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>640</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">rLayout.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>641</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>642</span> </span><span class="WHIT">         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">objSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInMan</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>643</span> </span><span class="WHIT">         </span><span class="NAME">objSIM.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Name</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>644</span> </span><span class="WHIT">         </span><span class="NAME">objSIM.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>645</span> </span><span class="WHIT">         </span><span class="NAME">objSIM.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//makes sense only for 'Bricks'.</span><span class="WHIT">
<span class='linenumber'>646</span> </span><span class="WHIT">         </span><span class="NAME">objSIM.XPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">XPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>647</span> </span><span class="WHIT">         </span><span class="NAME">objSIM.YPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">YPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>648</span> 
<span class='linenumber'>649</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Layout</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>650</span> </span><span class="WHIT">            </span><span class="NAME">objSIM.Layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rLayout</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Layout</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>651</span> </span><span class="WHIT">         </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>652</span> </span><span class="WHIT">            </span><span class="NAME">objSIM.Layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>653</span> </span><span class="WHIT">         </span><span class="COMM">//Add to the SIMS</span><span class="WHIT">
<span class='linenumber'>654</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">objSIM.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">objSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>655</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>656</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>657</span> 
<span class='linenumber'>658</span> </span><span class="WHIT">   </span><span class="NAME">this.loadCustomLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>659</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>660</span> </span><span class="WHIT">       </span><span class="NAME">units</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>661</span> </span><span class="WHIT">       </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">units</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>662</span> </span><span class="WHIT">       </span><span class="PUNC">{</span><span class="WHIT">        </span><span class="WHIT">
<span class='linenumber'>663</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'doc'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//ignore</span><span class="WHIT">
<span class='linenumber'>664</span> </span><span class="WHIT">        </span><span class="COMM">//alert(X) ;</span><span class="WHIT">
<span class='linenumber'>665</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">objSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInMan</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>666</span> </span><span class="WHIT">        </span><span class="NAME">objSIM.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>667</span> </span><span class="WHIT">        </span><span class="NAME">objSIM.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">units</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">w</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>668</span> </span><span class="WHIT">        </span><span class="NAME">objSIM.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">units</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//makes sense only for 'Bricks'.</span><span class="WHIT">
<span class='linenumber'>669</span> </span><span class="WHIT">        </span><span class="NAME">objSIM.XPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">units</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>670</span> </span><span class="WHIT">        </span><span class="NAME">objSIM.YPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">units</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>671</span> </span><span class="WHIT">       </span><span class="WHIT">
<span class='linenumber'>672</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'bottom'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'top'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>673</span> </span><span class="WHIT">               </span><span class="NAME">objSIM.Layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutBrick</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>674</span> </span><span class="WHIT">         </span><span class="COMM">//Add to the SIMS</span><span class="WHIT">
<span class='linenumber'>675</span> </span><span class="WHIT">         </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">objSIM.Name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">objSIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">                    </span><span class="WHIT">
<span class='linenumber'>676</span> </span><span class="WHIT">       </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>677</span> </span><span class="WHIT">       </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">units</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>678</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>679</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>680</span> </span><span class="WHIT">   </span><span class="COMM">//called on success</span><span class="WHIT">
<span class='linenumber'>681</span> </span><span class="WHIT">   </span><span class="NAME">this.loaderCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>682</span> </span><span class="WHIT">      </span><span class="NAME">o.data.mc.postRegisterSnap</span><span class="PUNC">(</span><span class="NAME">o.data.theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">o.data.strSnapID</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>683</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>684</span> 
<span class='linenumber'>685</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>686</span> </span><span class="WHIT">   </span><span class="NAME">this.registerSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSnapID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>687</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>688</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>689</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>690</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>691</span> </span><span class="WHIT">         </span><span class="NAME">this.postRegisterSnap</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSnapID</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>692</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>693</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>694</span> 
<span class='linenumber'>695</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>696</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>697</span> </span><span class="WHIT">         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Loader</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.YUILoader</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>698</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='linenumber'>699</span> </span><span class="WHIT">        </span><span class="NAME">base</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">NS2112.aPortalSettings</span><span class="PUNC">[</span><span class="STRN">'YUI_PATH'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>700</span> 
<span class='linenumber'>701</span> </span><span class="WHIT">		</span><span class="COMM">//filter: "DEBUG", 	//use debug versions (or apply some</span><span class="WHIT">
<span class='linenumber'>702</span> </span><span class="WHIT">							</span><span class="COMM">//some other filter?</span><span class="WHIT">
<span class='linenumber'>703</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>704</span> </span><span class="WHIT">		</span><span class="NAME">loadOptional</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">//load all optional dependencies?</span><span class="WHIT">
<span class='linenumber'>705</span> </span><span class="WHIT">        </span><span class="COMM">// should a failure occur, the onFailure function will be executed</span><span class="WHIT">
<span class='linenumber'>706</span> </span><span class="WHIT">        </span><span class="NAME">onFailure</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>707</span> </span><span class="WHIT">            </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"error: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">YAHOO.lang.dump</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>708</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>709</span> 
<span class='linenumber'>710</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>711</span> </span><span class="WHIT">       </span><span class="NAME">Loader.data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>712</span> </span><span class="WHIT">       </span><span class="NAME">Loader.data</span><span class="PUNC">[</span><span class="STRN">"mc"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>713</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>714</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>715</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>716</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>717</span> </span><span class="WHIT">         </span><span class="NAME">Loader.require</span><span class="PUNC">(</span><span class="NAME">rDependencyLibs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>718</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>719</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">rDependencyLibs.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>720</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>721</span> </span><span class="WHIT">      </span><span class="COMM">//alert(strSnapID + " needs libs") ;</span><span class="WHIT">
<span class='linenumber'>722</span> </span><span class="WHIT">         </span><span class="NAME">Loader.data</span><span class="PUNC">[</span><span class="STRN">"theSnap"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>723</span> </span><span class="WHIT">         </span><span class="NAME">Loader.data</span><span class="PUNC">[</span><span class="STRN">"strSnapID"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strSnapID</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>724</span> </span><span class="WHIT">         </span><span class="NAME">Loader.onSuccess</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.loaderCallback</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>725</span> </span><span class="WHIT">         </span><span class="NAME">Loader.insert</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>726</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>727</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>728</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>729</span> 
<span class='linenumber'>730</span> </span><span class="WHIT">   </span><span class="COMM">//on initial registering the snap would alway be displayed on slot Zero (TopMost/LeftMost)</span><span class="WHIT">
<span class='linenumber'>731</span> </span><span class="WHIT">   </span><span class="NAME">this.postRegisterSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSnapID</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>732</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>733</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bFoundHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>734</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>735</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>736</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>737</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>738</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>739</span> </span><span class="WHIT">      </span><span class="COMM">//on registering we try to find a host for this snap</span><span class="WHIT">
<span class='linenumber'>740</span> 
<span class='linenumber'>741</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.Intrinsic</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>742</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>743</span> </span><span class="WHIT">         </span><span class="NAME">m_rIntrinsics</span><span class="PUNC">[</span><span class="NAME">theSnap.IntrinsicType</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>744</span> </span><span class="WHIT">         </span><span class="NAME">theSnap.load</span><span class="PUNC">(</span><span class="NAME">this.createContainer</span><span class="PUNC">(</span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>745</span> </span><span class="WHIT">         </span><span class="NAME">this.onIntrinsicReady.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>746</span> </span><span class="WHIT">         </span><span class="NAME">this.onSnapInLoaded.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//need this for content snap...</span><span class="WHIT">
<span class='linenumber'>747</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>748</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>749</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>750</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>751</span> 
<span class='linenumber'>752</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'registerSnap['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] Width  ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>753</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'registerSnap['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] Height  ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>754</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>755</span> 
<span class='linenumber'>756</span> </span><span class="WHIT">      </span><span class="COMM">//singleton: our simRegistry is fueled by an intrinisc snapin -> create it if not already</span><span class="WHIT">
<span class='linenumber'>757</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>758</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>759</span> </span><span class="WHIT">           </span><span class="NAME">m_rSIMRegistry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>760</span> </span><span class="WHIT">           </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">theLayout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.loadCustomLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>761</span> </span><span class="WHIT">          </span><span class="WHIT">
<span class='linenumber'>762</span> </span><span class="WHIT">           </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theLayout</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>763</span> </span><span class="WHIT">           </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>764</span> </span><span class="WHIT">               </span><span class="NAME">this.loadLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>765</span> </span><span class="WHIT">               </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"No Layout snapIn found, loading Defaults."</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_ERR</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>766</span> </span><span class="WHIT">           </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>767</span> </span><span class="WHIT">           </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>768</span> </span><span class="WHIT">           </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>769</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"Layout snapIn found, loaded custom."</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">                </span><span class="WHIT">
<span class='linenumber'>770</span> </span><span class="WHIT">               </span><span class="NAME">this.dumpLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>771</span> </span><span class="WHIT">           </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>772</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>773</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>774</span> </span><span class="WHIT">      </span><span class="STRN">'%'</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.UnitW</span><span class="PUNC">?</span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Dom.getViewportWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="PUNC">(</span><span class="NAME">theSnap.Width</span><span class="PUNC">/</span><span class="NUMB">100</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>775</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.UnitW</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>776</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'UnitW ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.UnitW</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] vpwidth ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Dom.getViewportWidth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>777</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] width was calculated to ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>778</span> </span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>779</span> </span><span class="WHIT">      </span><span class="STRN">'%'</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT">  </span><span class="NAME">theSnap.UnitH</span><span class="PUNC">?</span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">YAHOO.util.Dom.getViewportHeight</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">theSnap.Height</span><span class="PUNC">/</span><span class="NUMB">100</span><span class="PUNC">)</span><span class="PUNC">:</span><span class="NAME">iHeight</span><span class="PUNC">=</span><span class="NAME">theSnap.Height</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>780</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.UnitH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>781</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] height was calculated to ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>782</span> 
<span class='linenumber'>783</span> </span><span class="WHIT">      </span><span class="COMM">//?Where should we put the snap?</span><span class="WHIT">
<span class='linenumber'>784</span> </span><span class="WHIT">      </span><span class="COMM">//This function will be enhanced by respecting the snapins user - preference for a distinct sim.</span><span class="WHIT">
<span class='linenumber'>785</span> 
<span class='linenumber'>786</span> </span><span class="WHIT">      </span><span class="COMM">//first of all ask the prefferred sim to host - if it does not we have a small redundance in the for-loop, well...</span><span class="WHIT">
<span class='linenumber'>787</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">getSnapInDefinition</span><span class="PUNC">(</span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>788</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>789</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"###################### Search Def for ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>790</span> </span><span class="WHIT">                </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] Found ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">mySnapDef.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>791</span> </span><span class="WHIT">                </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>792</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>793</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"####################SNAPDEF is null for ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>794</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">mySnapDef</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">mySnapDef.SIM</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">mySnapDef.SIM</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">mySnapDef.SIM.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>795</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>796</span> </span><span class="WHIT">          </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"####################  The SNAP ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] wants SIM ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">mySnapDef.SIM</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>797</span> 
<span class='linenumber'>798</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">mySnapDef.SIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">canHost</span><span class="PUNC">(</span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">  </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>799</span> </span><span class="WHIT">          </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>800</span> </span><span class="WHIT">            </span><span class="NAME">theSnap.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mySnapDef.SIM</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">       </span><span class="WHIT">
<span class='linenumber'>801</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"####################  ShowSnapIn ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">                     </span><span class="WHIT">
<span class='linenumber'>802</span> </span><span class="WHIT">            </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">mySnapDef.SIM</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">showSnapIn</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.createContainer</span><span class="PUNC">(</span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>803</span> </span><span class="WHIT">            </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">strSnapID</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//do not add the Snap before showSnapIn!            </span><span class="WHIT">
<span class='linenumber'>804</span> </span><span class="WHIT">            </span><span class="NAME">this.adjustLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>805</span> </span><span class="WHIT">            </span><span class="NAME">this.onSnapInLoaded.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//to those who care</span><span class="WHIT">
<span class='linenumber'>806</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>807</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>808</span> </span><span class="WHIT">          </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"####################  SIM Rejected ["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>809</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>810</span> 
<span class='linenumber'>811</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>812</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">          </span><span class="WHIT">
<span class='linenumber'>813</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost Asking SIM ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>814</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">canHost</span><span class="PUNC">(</span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>815</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">//found a host</span><span class="WHIT">
<span class='linenumber'>816</span> </span><span class="WHIT">            </span><span class="NAME">bFoundHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>817</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost SIM ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] will host ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="WHIT">
<span class='linenumber'>818</span> </span><span class="WHIT">                 </span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>819</span> </span><span class="WHIT">            </span><span class="COMM">//set the SIMName into the Snap</span><span class="WHIT">
<span class='linenumber'>820</span> </span><span class="WHIT">            </span><span class="NAME">theSnap.m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">                            </span><span class="WHIT">
<span class='linenumber'>821</span> </span><span class="WHIT">            </span><span class="NAME">m_rSIMRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">showSnapIn</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.createContainer</span><span class="PUNC">(</span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>822</span> </span><span class="WHIT">            </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">strSnapID</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="COMM">//do not add the Snap before showSnapIn!</span><span class="WHIT">
<span class='linenumber'>823</span> </span><span class="WHIT">            </span><span class="NAME">this.onSnapInLoaded.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//to those who care</span><span class="WHIT">
<span class='linenumber'>824</span> </span><span class="WHIT">            </span><span class="KEYW">break</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>825</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>826</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">bFoundHost</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//need to force insertion on any host.</span><span class="WHIT">
<span class='linenumber'>827</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>828</span> </span><span class="WHIT">            </span><span class="COMM">//tbi</span><span class="WHIT">
<span class='linenumber'>829</span> </span><span class="WHIT">            </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost SIM ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] rejected.'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>830</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>831</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>832</span> </span><span class="WHIT">      </span><span class="NAME">this.adjustLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>833</span> </span><span class="WHIT">      </span><span class="NAME">this.onSnapInLoaded.fire</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>834</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>835</span> 
<span class='linenumber'>836</span> </span><span class="WHIT">  </span><span class="COMM">//Loading a single Snap</span><span class="WHIT">
<span class='linenumber'>837</span> </span><span class="WHIT">   </span><span class="NAME">this.loadSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>838</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>839</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>840</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mySnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">SnapDef</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>841</span> </span><span class="WHIT">      </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>842</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>843</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.sandboxMode</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>844</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>845</span> </span><span class="WHIT">        </span><span class="NAME">NS2112.include</span><span class="PUNC">(</span><span class="NAME">mySnap.URL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>846</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>847</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>848</span> </span><span class="WHIT">      </span><span class="NAME">rSnap.push</span><span class="PUNC">(</span><span class="NAME">mySnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>849</span> </span><span class="WHIT">      </span><span class="NAME">silo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInLoader</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>850</span> </span><span class="WHIT">      </span><span class="NAME">silo.loadSnap</span><span class="PUNC">(</span><span class="NAME">rSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">//rSnapIns, currently global above.</span><span class="WHIT">
<span class='linenumber'>851</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>852</span> 
<span class='linenumber'>853</span> </span><span class="COMM">//Calling all snapIns - by using our silo</span><span class="WHIT">
<span class='linenumber'>854</span> </span><span class="COMM">//TimerID is optional, when a caller decided to do a deferred run of the function</span><span class="WHIT">
<span class='linenumber'>855</span> </span><span class="COMM">//We clear the timer then.</span><span class="WHIT">
<span class='linenumber'>856</span> </span><span class="WHIT">   </span><span class="NAME">this.loadSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>857</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>858</span> </span><span class="WHIT">      </span><span class="NAME">rSnapIns.sort</span><span class="PUNC">(</span><span class="NAME">posSort</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>859</span> </span><span class="WHIT">      </span><span class="COMM">//snapInLoader      </span><span class="WHIT">
<span class='linenumber'>860</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>861</span> </span><span class="WHIT">       </span><span class="COMM">//load the snapin table</span><span class="WHIT">
<span class='linenumber'>862</span> </span><span class="WHIT">      </span><span class="COMM">//when in sanbox mode then do a simple include, to allow debugging</span><span class="WHIT">
<span class='linenumber'>863</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.sandboxMode</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>864</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>865</span> </span><span class="WHIT">         </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">rSnapIns.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>866</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>867</span> </span><span class="WHIT">              </span><span class="NAME">NS2112.include</span><span class="PUNC">(</span><span class="NAME">rSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">URL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>868</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>869</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>870</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>871</span> </span><span class="WHIT">      </span><span class="NAME">silo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInLoader</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>872</span> </span><span class="WHIT">      </span><span class="NAME">silo.loadSnap</span><span class="PUNC">(</span><span class="NAME">rSnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">//rSnapIns, currently global above.  </span><span class="WHIT">
<span class='linenumber'>873</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>874</span> 
<span class='linenumber'>875</span> </span><span class="WHIT">   </span><span class="NAME">this.includeModule</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadMin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadBeta</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>876</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>877</span> </span><span class="WHIT">      </span><span class="COMM">//snapInLoader  </span><span class="WHIT">
<span class='linenumber'>878</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.sandboxMode</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>879</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>880</span> </span><span class="WHIT">         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">strPath</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.aPortalSettings</span><span class="PUNC">[</span><span class="STRN">'YUI_PATH'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">strModuleName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">strModuleName</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>881</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">bLoadBeta</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strPath</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'-beta'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>882</span> </span><span class="WHIT">            </span><span class="NAME">bLoadMin</span><span class="PUNC">==</span><span class="KEYW">true</span><span class="PUNC">?</span><span class="NAME">strPath</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'-min.js'</span><span class="PUNC">:</span><span class="NAME">strPath</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'.js'</span><span class="WHIT">  </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>883</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.include</span><span class="PUNC">(</span><span class="NAME">strPath</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>884</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>885</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>886</span> </span><span class="WHIT">      </span><span class="NAME">silo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInLoader</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>887</span> </span><span class="WHIT">      </span><span class="NAME">silo.loadModule</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadMin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadBeta</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>888</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>889</span> 
<span class='linenumber'>890</span> </span><span class="WHIT">   </span><span class="NAME">this.inlineModule</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>891</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>892</span> </span><span class="WHIT">      </span><span class="COMM">//snapInLoader  </span><span class="WHIT">
<span class='linenumber'>893</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.sandboxMode</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>894</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>895</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.include</span><span class="PUNC">(</span><span class="NAME">NS2112.aPortalSettings</span><span class="PUNC">[</span><span class="STRN">'YUI_PATH'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">strModuleName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">strModuleName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.js'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>896</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>897</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>898</span> </span><span class="WHIT">      </span><span class="NAME">silo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">NS2112.snapInLoader</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>899</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">silo.loadModule</span><span class="PUNC">(</span><span class="NAME">strModuleName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>900</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>901</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>902</span> </span><span class="WHIT">   </span><span class="COMM">//load the SIMS from the Layout definition</span><span class="WHIT">
<span class='linenumber'>903</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>904</span> </span><span class="WHIT">   </span><span class="COMM">/*INTRINSICS*/</span><span class="WHIT">
<span class='linenumber'>905</span> </span><span class="WHIT">   </span><span class="NAME">m_rIntrinsics</span><span class="PUNC">[</span><span class="STRN">'snapin'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>906</span> </span><span class="WHIT">   </span><span class="NAME">m_rIntrinsics</span><span class="PUNC">[</span><span class="STRN">'logger'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>907</span> </span><span class="WHIT">   </span><span class="NAME">m_rIntrinsics</span><span class="PUNC">[</span><span class="STRN">'layout'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>908</span> 
<span class='linenumber'>909</span> </span><span class="WHIT">   </span><span class="NAME">this.debugShowAll</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>910</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>911</span> </span><span class="WHIT">      </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">'debugShowAll'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>912</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>913</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//calling all SIMS</span><span class="WHIT">
<span class='linenumber'>914</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>915</span> </span><span class="WHIT">         </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"showing "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>916</span> </span><span class="WHIT">         </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">//match         </span><span class="WHIT">
<span class='linenumber'>917</span> </span><span class="WHIT">         </span><span class="NAME">m_rSnapRegistry</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.moveTo</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>918</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>919</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>920</span> 
<span class='linenumber'>921</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>922</span> </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="COMM">//END OF MC</span><span class="WHIT">
<span class='linenumber'>923</span> 
<span class='linenumber'>924</span> 
<span class='linenumber'>925</span> </span><span class="COMM">//returns the portalman windowmanager.</span><span class="WHIT">
<span class='linenumber'>926</span> </span><span class="COMM">//snapins should use this function and not access the windowManager instance directly</span><span class="WHIT">
<span class='linenumber'>927</span> </span><span class="NAME">NS2112.getWindowManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>928</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>929</span> </span><span class="WHIT">   </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">portalMan.getWindowManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>930</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>931</span> 
<span class='linenumber'>932</span> </span><span class="NAME">NS2112.requestContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNewWindow</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>933</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>934</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">contentRequested</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="STRN">'content'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNewWindow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>935</span> </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>936</span> 
<span class='linenumber'>937</span> 
<span class='linenumber'>938</span> </span><span class="NAME">NS2112.requestContentFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">X</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Y</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>939</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>940</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">contentRequested</span><span class="PUNC">(</span><span class="STRN">'content'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">X</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>941</span> </span><span class="WHIT">                                                   </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//newWindow = true, float = true</span><span class="WHIT">
<span class='linenumber'>942</span> </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>943</span> 
<span class='linenumber'>944</span> </span><span class="NAME">NS2112.embedObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">strObjectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bNewWindow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strPreferredSIM</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>945</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>946</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strPreferredSIM</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strPreferredSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>947</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">contentRequested</span><span class="PUNC">(</span><span class="STRN">'embedded'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strObjectString</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>948</span> </span><span class="WHIT">                                       </span><span class="NAME">bNewWindow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strPreferredSIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//newWindow = true, float = true</span><span class="WHIT">
<span class='linenumber'>949</span> </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>950</span> 
<span class='linenumber'>951</span> 
<span class='linenumber'>952</span> </span><span class="NAME">NS2112.doResize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>953</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>954</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"beforeResize"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>955</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">adjustLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>956</span> 
<span class='linenumber'>957</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>958</span> 
<span class='linenumber'>959</span> </span><span class="NAME">NS2112.Log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strMsg</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strCategory</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>960</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>961</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getIntrinsic</span><span class="PUNC">(</span><span class="STRN">'logger'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//lowercase</span><span class="WHIT">
<span class='linenumber'>962</span> </span><span class="WHIT">   </span><span class="COMM">//if(l && l.IntriniscObject)</span><span class="WHIT">
<span class='linenumber'>963</span> </span><span class="WHIT">   </span><span class="COMM">//   l.IntrinsicObject.Log(strMsg) ;</span><span class="WHIT">
<span class='linenumber'>964</span> </span><span class="WHIT">   </span><span class="NAME">YAHOO.log</span><span class="PUNC">(</span><span class="NAME">strMsg</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strCategory</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>965</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>966</span> 
<span class='linenumber'>967</span> 
<span class='linenumber'>968</span> </span><span class="COMM">//no error checking - dev</span><span class="WHIT">
<span class='linenumber'>969</span> </span><span class="NAME">NS2112.registerSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">theSnapIn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strUniqueID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rDependencies</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>970</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>971</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">registerSnap</span><span class="PUNC">(</span><span class="NAME">theSnapIn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strUniqueID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rDependencies</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>972</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>973</span> 
<span class='linenumber'>974</span> 
<span class='linenumber'>975</span> </span><span class="NAME">NS2112.requires</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadMin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadBeta</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//yahoo, dom, event, dragdrop....</span><span class="WHIT">
<span class='linenumber'>976</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>977</span> </span><span class="WHIT">   </span><span class="COMM">//check if not already loaded</span><span class="WHIT">
<span class='linenumber'>978</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">YAHOO.env.getVersion</span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//not loaded</span><span class="WHIT">
<span class='linenumber'>979</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>980</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">includeModule</span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadMin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bLoadBeta</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>981</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>982</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>983</span> 
<span class='linenumber'>984</span> </span><span class="NAME">NS2112.inline</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//yahoo, dom, event, dragdrop....</span><span class="WHIT">
<span class='linenumber'>985</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>986</span> </span><span class="WHIT">   </span><span class="COMM">//check if not already loaded</span><span class="WHIT">
<span class='linenumber'>987</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">YAHOO.env.getVersion</span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//not loaded</span><span class="WHIT">
<span class='linenumber'>988</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>989</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">inlineModule</span><span class="PUNC">(</span><span class="NAME">YUI_MODULE_NAME</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>990</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>991</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>992</span> 
<span class='linenumber'>993</span> </span><span class="NAME">NS2112.requestSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>994</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>995</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>996</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>997</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'untitled'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>998</span> </span><span class="WHIT">   </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>999</span> </span><span class="WHIT">   </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">loadSnapIn</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strTitle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strSIM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1000</span> </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1001</span> 
<span class='linenumber'>1002</span> </span><span class="NAME">NS2112.loadCSS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">strURI</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//yahoo, dom, event, dragdrop....</span><span class="WHIT">
<span class='linenumber'>1003</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1004</span> </span><span class="WHIT">   </span><span class="COMM">//includeCSS(strURI) ;3</span><span class="WHIT">
<span class='linenumber'>1005</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">theCSS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"link"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1006</span> </span><span class="COMM">/*
<span class='linenumber'>1007</span>    theCSS.setAttribute("rel", "stylesheet");
<span class='linenumber'>1008</span>    theCSS.setAttribute("type", "text/css");
<span class='linenumber'>1009</span>    theCSS.setAttribute("href", file);
<span class='linenumber'>1010</span> */</span><span class="WHIT">
<span class='linenumber'>1011</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"rel"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1012</span> </span><span class="WHIT">   </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"stylesheet"</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1013</span> </span><span class="WHIT">   </span><span class="NAME">theCSS.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1014</span> 
<span class='linenumber'>1015</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"type"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1016</span> </span><span class="WHIT">   </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/css"</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1017</span> </span><span class="WHIT">   </span><span class="NAME">theCSS.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1018</span> 
<span class='linenumber'>1019</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createAttribute</span><span class="PUNC">(</span><span class="STRN">"href"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1020</span> </span><span class="WHIT">   </span><span class="NAME">a.nodeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strURI</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1021</span> </span><span class="WHIT">   </span><span class="NAME">theCSS.setAttributeNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1022</span> 
<span class='linenumber'>1023</span> </span><span class="WHIT">   </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">'head'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">item</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">appendChild</span><span class="PUNC">(</span><span class="NAME">theCSS</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>1024</span> 
<span class='linenumber'>1025</span> </span><span class="WHIT">   </span><span class="COMM">//document.body.appendChild ( theCSS );</span><span class="WHIT">
<span class='linenumber'>1026</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1027</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1028</span> 
<span class='linenumber'>1029</span> 
<span class='linenumber'>1030</span> 
<span class='linenumber'>1031</span> 
<span class='linenumber'>1032</span> 
<span class='linenumber'>1033</span> 
<span class='linenumber'>1034</span> 
<span class='linenumber'>1035</span> 
<span class='linenumber'>1036</span> </span><span class="NAME">NS2112.namespace</span><span class="PUNC">(</span><span class="STRN">"snapIn12Constraint"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//Precreate</span><span class="WHIT">
<span class='linenumber'>1037</span> 
<span class='linenumber'>1038</span> </span><span class="NAME">NS2112.snapIn12Constraint.preferredWidth</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1039</span> </span><span class="NAME">NS2112.snapIn12Constraint.preferredHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1040</span> </span><span class="NAME">NS2112.snapIn12Constraint.layoutBrick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'brick'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1041</span> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'column'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1042</span> 
<span class='linenumber'>1043</span> </span><span class="COMM">//to be refined:</span><span class="WHIT">
<span class='linenumber'>1044</span> </span><span class="COMM">//must depend on the column/rowset</span><span class="WHIT">
<span class='linenumber'>1045</span> </span><span class="NAME">NS2112.snapIn12Constraint.maxExtX</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">700</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1046</span> </span><span class="NAME">NS2112.snapIn12Constraint.maxExtY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">700</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1047</span> 
<span class='linenumber'>1048</span> 
<span class='linenumber'>1049</span> 
<span class='linenumber'>1050</span> 
<span class='linenumber'>1051</span> 
<span class='linenumber'>1052</span> </span><span class="NAME">NS2112.snapIn12</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1053</span> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">//Preset some stuff</span><span class="WHIT">
<span class='linenumber'>1054</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_responsibleSIM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1055</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_LoadPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1056</span> </span><span class="WHIT">   </span><span class="NAME">this.Title</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'I have no name!'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1057</span> </span><span class="WHIT">   </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="STRN">'2112'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1058</span> </span><span class="WHIT">   </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="NAME">NS2112.snapIn12Constraint.preferredWidth</span><span class="WHIT">  </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1059</span> </span><span class="WHIT">   </span><span class="NAME">this.UnitW</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1060</span> </span><span class="WHIT">   </span><span class="NAME">this.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.preferredHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1061</span> </span><span class="WHIT">   </span><span class="NAME">this.UnitH</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'px'</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1062</span> </span><span class="WHIT">   </span><span class="NAME">this.X</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1063</span> </span><span class="WHIT">   </span><span class="NAME">this.Y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1064</span> </span><span class="WHIT">   </span><span class="NAME">this.CanClose</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1065</span> </span><span class="WHIT">   </span><span class="NAME">this.Intrinsic</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1066</span> </span><span class="WHIT">   </span><span class="NAME">this.IntrinsicType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//internal use only</span><span class="WHIT">
<span class='linenumber'>1067</span> </span><span class="WHIT">   </span><span class="NAME">this.IntrinsicObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1068</span> </span><span class="WHIT">   </span><span class="NAME">this.FitToHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//width is always the max width of the host </span><span class="WHIT">
<span class='linenumber'>1069</span> </span><span class="WHIT">   </span><span class="NAME">this.FreeFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>1070</span> </span><span class="WHIT">   </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutBrick</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//there are two Layouts for a SnapIn: brick or pillar    </span><span class="WHIT">
<span class='linenumber'>1071</span> </span><span class="WHIT">   </span><span class="NAME">this.CurrentSlot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//the Slot in the SIM   </span><span class="WHIT">
<span class='linenumber'>1072</span> </span><span class="WHIT">   </span><span class="NAME">this.ShowTitleBar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//false for menus</span><span class="WHIT">
<span class='linenumber'>1073</span> </span><span class="WHIT">   </span><span class="NAME">this.ShowBorders</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//false for menus</span><span class="WHIT">
<span class='linenumber'>1074</span> </span><span class="WHIT">   </span><span class="NAME">this.AdjustHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//let mc recalc height - not always what you want (useful for joomla module box).</span><span class="WHIT">
<span class='linenumber'>1075</span> </span><span class="WHIT">   </span><span class="NAME">this.m_Panel</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1076</span> </span><span class="WHIT">   </span><span class="NAME">this.makeHey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">alert</span><span class="PUNC">(</span><span class="STRN">"Hey"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1077</span> </span><span class="WHIT">   </span><span class="NAME">this.load</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="COMM">/*empty override this*/</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//called from mc to load the snap</span><span class="WHIT">
<span class='linenumber'>1078</span> </span><span class="WHIT">   </span><span class="NAME">this.unload</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="COMM">/*empty override this*/</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1079</span> 
<span class='linenumber'>1080</span> </span><span class="WHIT">   </span><span class="NAME">this.clone</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1081</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1082</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oClone</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.clone</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1083</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getNewID</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1084</span> </span><span class="WHIT">      </span><span class="NAME">oClone.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1085</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.registerSnapIn</span><span class="PUNC">(</span><span class="NAME">oClone</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"com._2112_.intrinsics_"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1086</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oClone</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1087</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1088</span> 
<span class='linenumber'>1089</span> </span><span class="WHIT">   </span><span class="NAME">this.loadContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strURL</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1090</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="COMM">//standard overridable for content snapins to load an iframe</span><span class="WHIT">
<span class='linenumber'>1091</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">myIFrameSrc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"\""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">strURL</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\" frameborder=\"0\"  width=\"100%\" height=\"100%\""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='linenumber'>1092</span> </span><span class="WHIT">						</span><span class="STRN">"  align=\"center\""</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1093</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"&lt;div>&lt;iframe  src="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">myIFrameSrc</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">">.&lt;/iframe>&lt;/div>"</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1094</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1095</span> </span><span class="WHIT">   </span><span class="COMM">//The  SnapInManagers Name - this property will be controlled by the masterContoller</span><span class="WHIT">
<span class='linenumber'>1096</span> </span><span class="WHIT">   </span><span class="COMM">//i.e will change when the snap moves from one SIM to another</span><span class="WHIT">
<span class='linenumber'>1097</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1098</span> 
<span class='linenumber'>1099</span> 
<span class='linenumber'>1100</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1101</span> </span><span class="COMM">/*
<span class='linenumber'>1102</span>    The core SnapIn Manager
<span class='linenumber'>1103</span>    Keeps Track of the Position of snapIns
<span class='linenumber'>1104</span>    Handles Drag and Drop Operations
<span class='linenumber'>1105</span>    Handles Serialization/Deserialization
<span class='linenumber'>1106</span> */</span><span class="WHIT">
<span class='linenumber'>1107</span> 
<span class='linenumber'>1108</span> </span><span class="COMM">/**snapInMan or SIM in */</span><span class="WHIT">
<span class='linenumber'>1109</span> </span><span class="NAME">NS2112.snapInMan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theWindowMan</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1110</span> </span><span class="PUNC">{</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>1111</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1112</span> </span><span class="WHIT">   </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strName</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1113</span> </span><span class="WHIT">   </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1114</span> </span><span class="WHIT">   </span><span class="NAME">this.YPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1115</span> </span><span class="WHIT">   </span><span class="NAME">this.CurrentHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1116</span> </span><span class="WHIT">   </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//default layout is column</span><span class="WHIT">
<span class='linenumber'>1117</span> 
<span class='linenumber'>1118</span> </span><span class="WHIT">   </span><span class="COMM">//Width and Height are constraints to be checked</span><span class="WHIT">
<span class='linenumber'>1119</span> </span><span class="WHIT">   </span><span class="COMM">//No Snap may exceed these bounds.</span><span class="WHIT">
<span class='linenumber'>1120</span> </span><span class="WHIT">   </span><span class="COMM">//On queries form mc the SIM decides from these </span><span class="WHIT">
<span class='linenumber'>1121</span> </span><span class="WHIT">   </span><span class="COMM">//properties wether it could host the snap.</span><span class="WHIT">
<span class='linenumber'>1122</span> </span><span class="WHIT">   </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>1123</span> </span><span class="WHIT">   </span><span class="NAME">this.Height</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1124</span> 
<span class='linenumber'>1125</span> </span><span class="WHIT">   </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">posSortY</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1126</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.Y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b.Y</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1127</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1128</span> 
<span class='linenumber'>1129</span> </span><span class="WHIT">   </span><span class="COMM">/**
<span class='linenumber'>1130</span>     * Rebuilding the stack of snapIns.
<span class='linenumber'>1131</span>     * First all snapIns for this SIM are gathered from the MasterControl
<span class='linenumber'>1132</span>     * Afterwards the snapIns are sorted by position and then
<span class='linenumber'>1133</span>     * re-organized by the SIMs reposV method.
<span class='linenumber'>1134</span>    */</span><span class="WHIT">
<span class='linenumber'>1135</span> </span><span class="WHIT">   </span><span class="NAME">this.rebuild</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1136</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1137</span> </span><span class="WHIT">      </span><span class="NAME">m_rSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1138</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSnapIns</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1139</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rWorkItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1140</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1141</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT">  </span><span class="COMM">//copy into slots</span><span class="WHIT">
<span class='linenumber'>1142</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1143</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FitToHost</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1144</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1145</span> </span><span class="WHIT">            </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">NS2112.PADPANELPX</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1146</span> </span><span class="WHIT">            </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.resize</span><span class="PUNC">(</span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1147</span> </span><span class="WHIT">            </span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.getContentNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1148</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">el</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">el.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'90%'</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">el.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'96%'</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1149</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1150</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"+++++++++++++ EXT  "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1151</span> </span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>1152</span> </span><span class="COMM">/*
<span class='linenumber'>1153</span>         if( true === m_rSnapIns[X].AdjustHeight )  //if snap want's to get it's size managed
<span class='linenumber'>1154</span>         {        
<span class='linenumber'>1155</span>         }
<span class='linenumber'>1156</span> */</span><span class="WHIT">
<span class='linenumber'>1157</span> 
<span class='linenumber'>1158</span> </span><span class="WHIT">         </span><span class="NAME">rWorkItems.push</span><span class="PUNC">(</span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1159</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1160</span> </span><span class="WHIT">      </span><span class="NAME">rWorkItems.sort</span><span class="PUNC">(</span><span class="NAME">posSortY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1161</span> </span><span class="WHIT">      </span><span class="NAME">this.CurrentHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.reposV</span><span class="PUNC">(</span><span class="NAME">rWorkItems</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1162</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1163</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1164</span> 
<span class='linenumber'>1165</span> </span><span class="WHIT">   </span><span class="NAME">this.canHost</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">snapWidth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">snapHeight</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1166</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//decide, if we have capacity left to add another control  </span><span class="WHIT">
<span class='linenumber'>1167</span> </span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>1168</span> 
<span class='linenumber'>1169</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] myLayout ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1170</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] SnapWidth ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">snapWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1171</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] SnapHeight ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">snapHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1172</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] my Width ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1173</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">'canHost ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'] my Height ['</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">']'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">NS2112.CONST_CAT_INFO</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1174</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1175</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>1176</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">snapWidth</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1177</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1178</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1179</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT">  </span><span class="PUNC">(</span><span class="NAME">snapHeight</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">this.Height</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>1180</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1181</span> 
<span class='linenumber'>1182</span> </span><span class="WHIT">   </span><span class="NAME">this.queryDrop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//</span><span class="WHIT">
<span class='linenumber'>1183</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1184</span> </span><span class="WHIT">       </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1185</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1186</span> </span><span class="WHIT">      </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>1187</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1188</span> </span><span class="WHIT">              </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.YPos</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">this.YPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.Height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1189</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1190</span> 
<span class='linenumber'>1191</span> </span><span class="WHIT">   </span><span class="NAME">this.queryResize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">newWidth</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1192</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1193</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bRet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1194</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSnapIns</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1195</span> </span><span class="WHIT">      </span><span class="COMM">//we compare the new Value to the widest snapIn that has not 'FitToHost' set.</span><span class="WHIT">
<span class='linenumber'>1196</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1197</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1198</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">FitToHost</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1199</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">newWidth</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Width</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1200</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1201</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bRet</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1202</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1203</span> 
<span class='linenumber'>1204</span> 
<span class='linenumber'>1205</span> </span><span class="WHIT">   </span><span class="NAME">this.reposSnapInsV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1206</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1207</span> </span><span class="WHIT">      </span><span class="COMM">//Algorithmus:</span><span class="WHIT">
<span class='linenumber'>1208</span> </span><span class="WHIT">      </span><span class="COMM">//gehe alle snaps durch, wenn du das Snap triffst, das auf iPos positioniert ist</span><span class="WHIT">
<span class='linenumber'>1209</span> </span><span class="WHIT">      </span><span class="COMM">//�bernehme dessen X Pos </span><span class="WHIT">
<span class='linenumber'>1210</span> </span><span class="WHIT">      </span><span class="COMM">//Setze alle XPos der Snaps, die groesser oder gleiche der iPos sind auf X + meine H�he.</span><span class="WHIT">
<span class='linenumber'>1211</span> 
<span class='linenumber'>1212</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.X</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1213</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.Y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.YPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1214</span> 
<span class='linenumber'>1215</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1216</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1217</span> </span><span class="WHIT">       </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">POS</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.POS</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1218</span> </span><span class="WHIT">          </span><span class="NAME">theSnap.Y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Y</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="COMM">//simply take over this snaps X0</span><span class="WHIT">
<span class='linenumber'>1219</span> </span><span class="WHIT">       </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">POS</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">theSnap.POS</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1220</span> </span><span class="WHIT">       </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1221</span> </span><span class="WHIT">         </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">POS</span><span class="PUNC">++</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1222</span> </span><span class="WHIT">         </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap.Height</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1223</span> </span><span class="WHIT">         </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.moveTo</span><span class="PUNC">(</span><span class="NAME">this.XPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//YPos of this SIM</span><span class="WHIT">
<span class='linenumber'>1224</span> </span><span class="WHIT">       </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1225</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1226</span> </span><span class="WHIT">      </span><span class="COMM">//finally move theSnap</span><span class="WHIT">
<span class='linenumber'>1227</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.m_Panel.moveTo</span><span class="PUNC">(</span><span class="NAME">this.XPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.Y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1228</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1229</span> 
<span class='linenumber'>1230</span> </span><span class="WHIT">   </span><span class="NAME">this.reposSnapInsH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1231</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1232</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1233</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1234</span> </span><span class="WHIT">   </span><span class="COMM">//on relocation, we need to find a slot for this.</span><span class="WHIT">
<span class='linenumber'>1235</span> </span><span class="WHIT">   </span><span class="NAME">this.relocSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnapIns</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">POS</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isNew</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//handling is a bit different, when a new one arrives</span><span class="WHIT">
<span class='linenumber'>1236</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1237</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1238</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">isNew</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1239</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1240</span> </span><span class="WHIT">         </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1241</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1242</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tmpSnap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">POS</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//save the old element</span><span class="WHIT">
<span class='linenumber'>1243</span> 
<span class='linenumber'>1244</span> </span><span class="WHIT">      </span><span class="COMM">//if null then there is no old element.</span><span class="WHIT">
<span class='linenumber'>1245</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">tmpSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1246</span> 
<span class='linenumber'>1247</span> 
<span class='linenumber'>1248</span> </span><span class="WHIT">      </span><span class="NAME">iGap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap.POS</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//save gap where the old snap was</span><span class="WHIT">
<span class='linenumber'>1249</span> </span><span class="WHIT">      </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">theSnap.POS</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//empty the slot</span><span class="WHIT">
<span class='linenumber'>1250</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1251</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1252</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1253</span> </span><span class="WHIT">      </span><span class="COMM">//now reloc all</span><span class="WHIT">
<span class='linenumber'>1254</span> </span><span class="WHIT">      </span><span class="COMM">//Target (tmpSnap) and all following snaps will move one slot up</span><span class="WHIT">
<span class='linenumber'>1255</span> </span><span class="WHIT">      </span><span class="COMM">//except we hit the tail, where no target is</span><span class="WHIT">
<span class='linenumber'>1256</span> 
<span class='linenumber'>1257</span> </span><span class="WHIT">      </span><span class="COMM">//Alle elemente vor der GAP rutschen jeweils eins hoch bis zur gap.</span><span class="WHIT">
<span class='linenumber'>1258</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1259</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iGap</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">></span><span class="NAME">POS</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1260</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1261</span> </span><span class="WHIT">         </span><span class="COMM">//the Gap will be filled - a new Gap is created</span><span class="WHIT">
<span class='linenumber'>1262</span> </span><span class="WHIT">         </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1263</span> </span><span class="WHIT">         </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">POS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1264</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1265</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1266</span> </span><span class="WHIT">      </span><span class="COMM">// alle Elemente hinter der Gap rutschen eins nach vorne</span><span class="WHIT">
<span class='linenumber'>1267</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iGap</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">POS</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1268</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1269</span> </span><span class="WHIT">         </span><span class="COMM">//the Gap will be filled - a new Gap is created</span><span class="WHIT">
<span class='linenumber'>1270</span> </span><span class="WHIT">         </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1271</span> </span><span class="WHIT">         </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">POS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1272</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1273</span> 
<span class='linenumber'>1274</span> 
<span class='linenumber'>1275</span> </span><span class="WHIT">      </span><span class="NAME">theSnap.POS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">POS</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">        </span><span class="COMM">//set the new position</span><span class="WHIT">
<span class='linenumber'>1276</span> </span><span class="WHIT">      </span><span class="NAME">theSnapIns</span><span class="PUNC">[</span><span class="NAME">POS</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="COMM">//set at desired position.</span><span class="WHIT">
<span class='linenumber'>1277</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1278</span> 
<span class='linenumber'>1279</span> 
<span class='linenumber'>1280</span> </span><span class="WHIT">   </span><span class="COMM">//the elements are ordered - display from 0 to lenght-1</span><span class="WHIT">
<span class='linenumber'>1281</span> </span><span class="WHIT">   </span><span class="NAME">this.reposV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnapArray</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1282</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1283</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iOffsY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.YPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1284</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1285</span> </span><span class="WHIT"> </span><span class="COMM">//alert(theSnapArray.length) ;</span><span class="WHIT">
<span class='linenumber'>1286</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">theSnapArray.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1287</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1288</span> </span><span class="WHIT">         </span><span class="NAME">NS2112.Log</span><span class="PUNC">(</span><span class="STRN">"+++++++++++++"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.getWindowName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' moveTo '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">NS2112.PADPANELPX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'/'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">iOffsY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1289</span> </span><span class="WHIT">      </span><span class="COMM">//alert(theSnapArray[i].m_Panel.getWindowName() + ' moveTo ' + (this.XPos + NS2112.PADPANELPX) + '/' + iOffsY) ;</span><span class="WHIT">
<span class='linenumber'>1290</span> </span><span class="WHIT"> </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.moveTo</span><span class="PUNC">(</span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">NS2112.PADPANELPX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iOffsY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//YPos of this SIM</span><span class="WHIT">
<span class='linenumber'>1291</span> 
<span class='linenumber'>1292</span> </span><span class="WHIT">         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">m_Panel.getWindowName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1293</span> </span><span class="WHIT">         </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">X</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.XPos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">NS2112.PADPANELPX</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1294</span> </span><span class="WHIT">         </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iOffsY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">NS2112.PADPANELPX</span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1295</span> </span><span class="WHIT">         </span><span class="NAME">iOffsY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT">  </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>1296</span> </span><span class="WHIT">         </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnapArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">Height</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1297</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1298</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">iHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1299</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1300</span> 
<span class='linenumber'>1301</span> 
<span class='linenumber'>1302</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1303</span> </span><span class="WHIT">   </span><span class="NAME">this.onContentLoaded</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1304</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1305</span> </span><span class="WHIT">      </span><span class="COMM">//alert(myPanel.getWindowExtY() ) ;</span><span class="WHIT">
<span class='linenumber'>1306</span> </span><span class="WHIT">      </span><span class="COMM">/*
<span class='linenumber'>1307</span>       var newHeight = myPanel.getWindowExtY() ;
<span class='linenumber'>1308</span>       xpRepos (theSnap.m_Panel, theSnap.Width, newHeight);
<span class='linenumber'>1309</span>       theSnap.Height = newHeight;
<span class='linenumber'>1310</span>       */</span><span class="WHIT">
<span class='linenumber'>1311</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1312</span> 
<span class='linenumber'>1313</span> 
<span class='linenumber'>1314</span> 
<span class='linenumber'>1315</span> </span><span class="WHIT">   </span><span class="NAME">this.showSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elContainer</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">strElementName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iPreferredPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bCanFloat</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//optional: Position to insert, Default: Zero.</span><span class="WHIT">
<span class='linenumber'>1316</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1317</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">iPreferredPos</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">iPreferredPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//Top or Leftmost Position</span><span class="WHIT">
<span class='linenumber'>1318</span> </span><span class="WHIT">     </span><span class="NAME">applyConstraints</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1319</span> </span><span class="WHIT">     </span><span class="COMM">//get all my snaps to check where to add this one</span><span class="WHIT">
<span class='linenumber'>1320</span> </span><span class="WHIT">     </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSnapIns</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1321</span> </span><span class="WHIT">     </span><span class="NAME">theSnap.POS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iPreferredPos</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>1322</span> </span><span class="WHIT">     </span><span class="COMM">//ask the snapIn to load itself </span><span class="WHIT">
<span class='linenumber'>1323</span> </span><span class="WHIT">     </span><span class="NAME">myEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">theSnap.load</span><span class="PUNC">(</span><span class="NAME">elContainer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//use bugPrison to first create hidden. </span><span class="WHIT">
<span class='linenumber'>1324</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>1325</span> </span><span class="WHIT">     </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">myEl</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">myEl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"&lt;b>not loaded&lt;/b>"</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//do not display </span><span class="WHIT">
<span class='linenumber'>1326</span> </span><span class="WHIT">        </span><span class="WHIT">
<span class='linenumber'>1327</span> </span><span class="WHIT">     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1328</span> </span><span class="COMM">//alert('showSnapIn creating...') ;</span><span class="WHIT">
<span class='linenumber'>1329</span> </span><span class="WHIT">     </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mc.createSnapIn</span><span class="PUNC">(</span><span class="NAME">theSnap.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.Title</span><span class="PUNC">,</span><span class="WHIT">
<span class='linenumber'>1330</span> </span><span class="WHIT">                        </span><span class="NAME">myEl</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1331</span> </span><span class="WHIT">                        </span><span class="NAME">theSnap.Width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.UnitW</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.Height</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.UnitH</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1332</span> </span><span class="WHIT">                        </span><span class="NAME">theSnap.DropDown</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">theSnap.CanClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//false - no floating</span><span class="WHIT">
<span class='linenumber'>1333</span> 
<span class='linenumber'>1334</span> </span><span class="WHIT">     </span><span class="NAME">theSnap.m_Panel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">myPanel</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">//store</span><span class="WHIT">
<span class='linenumber'>1335</span> 
<span class='linenumber'>1336</span> </span><span class="WHIT">     </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.ShowTitleBar</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1337</span> </span><span class="WHIT">     </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1338</span> </span><span class="WHIT">       </span><span class="COMM">//myPanel.header.style.display = 'none';</span><span class="WHIT">
<span class='linenumber'>1339</span> 
<span class='linenumber'>1340</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1341</span> </span><span class="WHIT">     </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.ShowBorders</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1342</span> </span><span class="WHIT">     </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1343</span> </span><span class="WHIT">       </span><span class="COMM">//myPanel.body.style.border = 'none';</span><span class="WHIT">
<span class='linenumber'>1344</span> </span><span class="WHIT">     </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1345</span> 
<span class='linenumber'>1346</span> 
<span class='linenumber'>1347</span> 
<span class='linenumber'>1348</span> </span><span class="WHIT">     </span><span class="COMM">//reposSnapIns would set the initial X/Y Coords which is neccessary to sort the panels.</span><span class="WHIT">
<span class='linenumber'>1349</span> 
<span class='linenumber'>1350</span> </span><span class="WHIT">     </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">this.Layout</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.layoutColumn</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1351</span> </span><span class="WHIT">      </span><span class="NAME">this.reposSnapInsV</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iPreferredPos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//Vertical repositioning. true -> a new snap is inserted</span><span class="WHIT">
<span class='linenumber'>1352</span> </span><span class="WHIT">     </span><span class="KEYW">else</span><span class="WHIT">
<span class='linenumber'>1353</span> </span><span class="WHIT">      </span><span class="NAME">this.reposSnapInsH</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//Horizontal repositioning. true -> a new snap is inserted   </span><span class="WHIT">
<span class='linenumber'>1354</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='linenumber'>1355</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1356</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>1357</span> 
<span class='linenumber'>1358</span> </span><span class="COMM">//alert(theSnap.Name + "/" + myPanel.body.firstChild.clientHeight) ;</span><span class="WHIT">
<span class='linenumber'>1359</span> 
<span class='linenumber'>1360</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='linenumber'>1361</span> 
<span class='linenumber'>1362</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1363</span> </span><span class="WHIT">   </span><span class="NAME">this.showSnapIns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elBugPrison</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1364</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">//load all registered</span><span class="WHIT">
<span class='linenumber'>1365</span> </span><span class="WHIT">      </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSnapIns</span><span class="PUNC">(</span><span class="NAME">this.Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1366</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">X</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1367</span> </span><span class="WHIT">      </span><span class="PUNC">{</span><span class="WHIT">         </span><span class="WHIT">
<span class='linenumber'>1368</span> </span><span class="WHIT">         </span><span class="NAME">snap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">m_rSnapIns</span><span class="PUNC">[</span><span class="NAME">X</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1369</span> </span><span class="WHIT">         </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">snap</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1370</span> </span><span class="WHIT">         </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1371</span> </span><span class="WHIT">            </span><span class="COMM">//Show on the Canvas</span><span class="WHIT">
<span class='linenumber'>1372</span> </span><span class="WHIT">            </span><span class="NAME">this.showSnapIn</span><span class="PUNC">(</span><span class="NAME">snap</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">            </span><span class="WHIT">
<span class='linenumber'>1373</span> </span><span class="WHIT">         </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1374</span> </span><span class="WHIT">         </span><span class="COMM">//else {} //todo - load error snap</span><span class="WHIT">
<span class='linenumber'>1375</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1376</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1377</span> 
<span class='linenumber'>1378</span> 
<span class='linenumber'>1379</span> 
<span class='linenumber'>1380</span> </span><span class="COMM">//do not allow to rave on the canvas</span><span class="WHIT">
<span class='linenumber'>1381</span> </span><span class="COMM">//needs to be enhanced:</span><span class="WHIT">
<span class='linenumber'>1382</span> </span><span class="COMM">//The constraints depend on the layout...</span><span class="WHIT">
<span class='linenumber'>1383</span> </span><span class="WHIT">   </span><span class="NAME">applyConstraints</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">theSnap</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1384</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1385</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1386</span> </span><span class="WHIT">          </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.preferredWidth</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1387</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">theSnap.Height</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">theSnap.Height</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1388</span> </span><span class="WHIT">         </span><span class="NAME">theSnap.Height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.snapIn12Constraint.preferredHeight</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1389</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1390</span> </span><span class="WHIT">           </span><span class="NAME">theSnap.Width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.Width</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1391</span> </span><span class="WHIT">      </span><span class="COMM">//if (theSnap.Height > this.Height ) //? this we should think over since Height may be endless</span><span class="WHIT">
<span class='linenumber'>1392</span> </span><span class="WHIT">      </span><span class="COMM">//     theSnap.Height = this.Height ;</span><span class="WHIT">
<span class='linenumber'>1393</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">  </span><span class="WHIT">
<span class='linenumber'>1394</span> 
<span class='linenumber'>1395</span> </span><span class="WHIT">   </span><span class="NAME">this.unloadSnapIn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">strSnapInName</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1396</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1397</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">si</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">NS2112.portalMan.getMasterControl</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSnapIn</span><span class="PUNC">(</span><span class="NAME">strSnapInName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1398</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">si</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1399</span> </span><span class="WHIT">         </span><span class="NAME">si.unload</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT">
<span class='linenumber'>1400</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">
<span class='linenumber'>1401</span> 
<span class='linenumber'>1402</span> </span><span class="WHIT">   </span><span class="NAME">this.snapToSlot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='linenumber'>1403</span> </span><span class="WHIT">   </span><span class="PUNC">{</span><span class="WHIT">
<span class='linenumber'>1404</span> </span><span class="WHIT">      </span><span class="WHIT">
<span class='linenumber'>1405</span> </span><span class="WHIT">   </span><span class="PUNC">}</span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1406</span> </span><span class="WHIT">   </span><span class="WHIT">
<span class='linenumber'>1407</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='linenumber'>1408</span> </span><span class="WHIT"> </span><span class="COMM">//SIM Ends</span><span class="WHIT">
<span class='linenumber'>1409</span> 
<span class='linenumber'>1410</span> 
<span class='linenumber'>1411</span> 
<span class='linenumber'>1412</span> 
<span class='linenumber'>1413</span> 
<span class='linenumber'>1414</span> 
<span class='linenumber'>1415</span> 
<span class='linenumber'>1416</span> 
<span class='linenumber'>1417</span> </span></pre></body></html>